package no.ntnu.fp.watch.gui;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.text.DecimalFormat;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class WellTableRenderer extends DefaultTableCellRenderer
{
	public Component getTableCellRendererComponent( JTable table, String value,
            boolean isSelected, boolean hasFocus, int row, int column) {
		
		JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, 
																   hasFocus, row, column);
		
		if(column == 0)
			label.setFont(new Font("Roman", Font.BOLD, 15));
	
		else if(column == 3){
			DecimalFormat formatter = new DecimalFormat( "0.000000000" );
			value = formatter.format(value);
			label.setText(value);
		}
		label.setBackground(Color.blue);
		return label;
	}
}
